﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:charting="clr-namespace:System.Windows.Controls.DataVisualization.Charting;assembly=System.Windows.Controls.DataVisualization.Toolkit"    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"  
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:datavis="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit" 
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:app="clr-namespace:DemoNYTimes"
    xmlns:nyt="clr-namespace:NYTimes;assembly=NYTimesSilverlightKit"
    xmlns:nytvc="clr-namespace:NYTimes.ValueConverters;assembly=NYTimesSilverlightKit"         
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" d:DesignWidth="640" d:DesignHeight="480"
    x:Class="DemoNYTimes.MainPage"
    mc:Ignorable="d"
    >
    <UserControl.Resources>
    	<app:ViewModel x:Key="ViewModelDataSource" d:IsDataSource="True"/>
    	<DataTemplate x:Key="ItemsTemplate">
    		<TextBlock Text="{Binding Mode=OneWay}"/>
    	</DataTemplate>
    	<ItemsPanelTemplate x:Key="ProductPanel">
            <StackPanel Orientation="Horizontal"/>
        </ItemsPanelTemplate>

        <!-- Tab Item Style -->
        <Style x:Key="TabItemStyle1" TargetType="sdk:TabItem">
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontFamily" Value="Arial"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="sdk:TabItem">
                        <Grid x:Name="Root">
                            <VisualStateManager.VisualStateGroups>

                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="SelectionStates">
                                    <VisualState x:Name="Unselected" />
                                    <VisualState x:Name="Selected" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates"/>
                            </VisualStateManager.VisualStateGroups>


                            <Grid x:Name="TemplateTopSelected" Visibility="Collapsed" >
                                <Border Background="#FFFFFF" BorderBrush="#CCCCCC" BorderThickness="1,1,1,0" Margin="0,0,0,0">
                                    <Grid>
                                        <ContentControl x:Name="HeaderTopSelected" IsTabStop="False"
                                                        Foreground="{TemplateBinding Foreground}"
                                                        FontSize="{TemplateBinding FontSize}"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Margin="{TemplateBinding Padding}"
                                                        Cursor="{TemplateBinding Cursor}" />
                                    </Grid>
                                </Border>
                            </Grid>
                            <Grid x:Name="TemplateTopUnselected" Visibility="Collapsed" Canvas.ZIndex="1">
                                <Border Background="#F0F4F5" BorderBrush="#CCCCCC" BorderThickness="1,1,1,1" Margin="0,0,0,0">
                                    <Grid>
                                        <ContentControl x:Name="HeaderTopUnselected" IsTabStop="False"
                                                        Foreground="{TemplateBinding Foreground}"
                                                        FontSize="{TemplateBinding FontSize}"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Margin="{TemplateBinding Padding}"
                                                        Cursor="{TemplateBinding Cursor}" />
                                    </Grid>
                                </Border>
                            </Grid>
                            <Grid x:Name="TemplateBottomSelected" Visibility="Collapsed" Canvas.ZIndex="1">
                                <Border BorderBrush="#CCCCCC" BorderThickness="1,0,1,1" Margin="-2,0,-2,-2">
                                    <Grid>
                                        <ContentControl x:Name="HeaderBottomSelected" IsTabStop="False"
                                                        Foreground="{TemplateBinding Foreground}"
                                                        FontSize="{TemplateBinding FontSize}"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Margin="{TemplateBinding Padding}"
                                                        Cursor="{TemplateBinding Cursor}" />
                                    </Grid>
                                </Border>
                            </Grid>
                            <Grid x:Name="TemplateBottomUnselected" Visibility="Collapsed">
                                <Border Background="#F0F4F5" BorderBrush="#CCCCCC" BorderThickness="1,0,1,1">
                                    <Grid>
                                        <ContentControl x:Name="HeaderBottomUnselected" IsTabStop="False"
                                                        Foreground="{TemplateBinding Foreground}"
                                                        FontSize="{TemplateBinding FontSize}"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Margin="{TemplateBinding Padding}"
                                                        Cursor="{TemplateBinding Cursor}" />
                                    </Grid>
                                </Border>
                            </Grid>
                            <Grid x:Name="TemplateLeftSelected" Visibility="Collapsed" Canvas.ZIndex="1">
                                <Border BorderBrush="#CCCCCC" BorderThickness="1,1,0,1" Margin="-2,-2,0,-2">
                                    <Grid>
                                        <ContentControl x:Name="HeaderLeftSelected" IsTabStop="False"
                                                        Foreground="{TemplateBinding Foreground}"
                                                        FontSize="{TemplateBinding FontSize}"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Margin="{TemplateBinding Padding}"
                                                        Cursor="{TemplateBinding Cursor}" />
                                    </Grid>
                                </Border>
                            </Grid>
                            <Grid x:Name="TemplateLeftUnselected" Visibility="Collapsed">
                                <Border Background="#F0F4F5" BorderBrush="#CCCCCC" BorderThickness="1,1,0,1">
                                    <Grid>
                                        <ContentControl x:Name="HeaderLeftUnselected" IsTabStop="False"
                                                        Foreground="{TemplateBinding Foreground}"
                                                        FontSize="{TemplateBinding FontSize}"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Margin="{TemplateBinding Padding}"
                                                        Cursor="{TemplateBinding Cursor}" />
                                    </Grid>
                                </Border>
                            </Grid>
                            <Grid x:Name="TemplateRightSelected" Visibility="Collapsed" Canvas.ZIndex="1">
                                <Border BorderBrush="#CCCCCC" BorderThickness="0,1,1,1" Margin="0,-2,-2,-2">
                                    <Grid>
                                        <ContentControl x:Name="HeaderRightSelected" IsTabStop="False"
                                                        Foreground="{TemplateBinding Foreground}"
                                                        FontSize="{TemplateBinding FontSize}"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Margin="{TemplateBinding Padding}"
                                                        Cursor="{TemplateBinding Cursor}" />
                                    </Grid>
                                </Border>
                            </Grid>
                            <Grid x:Name="TemplateRightUnselected" Visibility="Collapsed">
                                <Border Background="#F0F4F5" BorderBrush="#CCCCCC" BorderThickness="0,1,1,1">
                                    <Grid>
                                        <ContentControl x:Name="HeaderRightUnselected" IsTabStop="False"
                                                        Foreground="{TemplateBinding Foreground}"
                                                        FontSize="{TemplateBinding FontSize}"
                                                        HorizontalAlignment="Center"
                                                        VerticalAlignment="Center"
                                                        Margin="{TemplateBinding Padding}"
                                                        Cursor="{TemplateBinding Cursor}" />
                                    </Grid>
                                </Border>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource ViewModelDataSource}}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="Auto"/>
    		<RowDefinition/>
    		<RowDefinition Height="Auto"/>
    	</Grid.RowDefinitions>
    	<TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Grid.ColumnSpan="2" FontFamily="Times New Roman" FontSize="24" Text="New York Times APIs" TextWrapping="Wrap" Margin="4,4,4,4" x:Name="Title"/>
    	<StackPanel Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Top" Width="Auto" Grid.Column="1" Grid.Row="2" x:Name="Footer" Margin="4,2,4,4">
    		<Grid Height="Auto" Visibility="Visible">
    			<Grid.ColumnDefinitions>
    				<ColumnDefinition Width="Auto"/>
    				<ColumnDefinition/>
    				<ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
    			</Grid.ColumnDefinitions>
    		</Grid>
            
            
    		<HyperlinkButton Content="Created by Michael S. Scherotter, Microsoft Corporation - 11/16/2010" HorizontalAlignment="Right" TargetName="_blank" NavigateUri="http://blogs.msdn.com/synergist" FontFamily="Times New Roman" FontSize="14"/>
    	</StackPanel>
    	<ListBox x:Name="PageList" Grid.Row="1" ItemsSource="{Binding Pages}" SelectionChanged="OnPageSelected" DisplayMemberPath="Name" FontFamily="Times New Roman" FontSize="16"/>
        
    	<sdk:Frame x:Name="frame" Grid.Column="1" Grid.Row="1" Source="/DemoNYTimes;component/ArticlesPage.xaml"/>
        
    </Grid>
</UserControl>
